// 1.引入mock
import Mock from 'mockjs';
import homeApi from './mockServeData/home'
import user from './mockServeData/user'
import permission from './mockServeData/permission'

// 2.定义mock接口请求拦截(url路径、请求类型)
Mock.mock('/api/home/getData', homeApi.getStatisticalData); // 这个相当于下面那种写法，如果不传参数类型的话，默认为get请求

// Mock.mock('/api/home/getData', 'get', () => {
//     return homeApi.getStatisticalData();
// })

// 用户列表的数据
Mock.mock('/api/user/add', 'post', user.createUser)
Mock.mock('/api/user/edit', 'post', user.updateUser)
Mock.mock('/api/user/del', 'post', user.deleteUser)
Mock.mock(/api\/user\/getUser/, user.getUserList)
Mock.mock(/api\/permission\/getMenu/, 'post', permission.getMenu)

// 3.在main.js中引入即可
// import './api/mock';
